package com.wechat.android.app.ui.userinfo;
import android.content.Intent;
import android.text.TextUtils;
import android.view.View;

import com.wechat.android.app.R;
import com.wechat.android.app.ui.BaseActivity;
import com.wechat.android.app.widget.CustomFontEditText;
import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by yang on 2018/1/18.
 */

public class UpdateUserNameActivity extends BaseActivity {
    @BindView(R.id.et_name)
    CustomFontEditText etName;

    @Override
    protected int attachLayoutRes() {
        return R.layout.activity_update_user_name;
    }

    @Override
    protected void initInjector() {

    }

    @Override
    protected void initViews() {
        getToolbarTitle().setText("\uD81B\uDF50\uD81B\uDF37\uD81B\uDFD1\uD81B\uDF1E\uD81B\uDF6A\uD81B\uDF0A\uD81B\uDF61");
        getSubTitle().setText("\uD81B\uDF3B\uD81B\uDFD4\uD81B\uDF0A\uD81B\uDF58");
    }

    @Override
    protected void updateViews() {

    }

    @OnClick({R.id.toolbar_subtitle})
    public void viewOnClick(View view) {
        String userName = etName.getText().toString();
        if (TextUtils.isEmpty(userName)) {
            etName.requestFocus();
            mMStatusDialog.show("\uD81B\uDF26\uD81B\uDFA9\uD81B\uDF3D\uD81B\uDFA0\uD81B\uDF1E\uD81B\uDF59\uD81B\uDF50\uD81B\uDF37\uD81B\uDFD1\uD81B\uDF1E\uD81B\uDF68\uD81B\uDF2F\uD81B\uDFAA", null);
            return;
        }
        Intent ti = new Intent();
        ti.putExtra("userName", userName);
        setResult(RESULT_OK, ti);
        finish();
    }

}
